<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>MaterialReport管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#btnExport").click(function(){
				top.$.jBox.confirm("确认要导出物料数据吗？","系统提示",function(v,h,f){
					if(v=="ok"){
						$("#searchForm").attr("action","${ctx}/warehouse/materialReport/export");
						$("#searchForm").submit();
					}
				},{buttonsFocus:1});
				top.$('.jbox-body .jbox-icon').css('top','55px');
			});
			$("#btnSubmit").click(function(){
						$("#searchForm").attr("action","${ctx}/warehouse/materialReport/");
						$("#searchForm").submit();
					}
			);
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").attr("action","${ctx}/warehouse/materialReport/");
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/warehouse/materialReport/">MaterialReport List</a></li>
		<shiro:hasPermission name="warehouse:materialReport:edit"><li><a href="${ctx}/warehouse/materialReport/form">MaterialReport Add</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="materialReport" action="${ctx}/warehouse/materialReport/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			
			<li><label>office：</label>
				<sys:treeselect id="office" name="office.id" value="${materialReport.office.id}" labelName="office.name" labelValue="${materialReport.office.name}"
					title="部门" url="/sys/office/treeData?type=2" cssClass="input-small" allowClear="true" notAllowSelectParent="true"/>
			</li>
		
			<li><label>in_out：</label>
				<form:select path="inOut" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('inout')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li>
				<label>inoutdate：&nbsp;</label><input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
					value="<fmt:formatDate value="${materialReport.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
				&nbsp;--&nbsp;<input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
					value="<fmt:formatDate value="${materialReport.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>&nbsp;&nbsp;
			</li>
			<li><label>Material：</label>
				<form:input path="materialname" htmlEscape="false" maxlength="300" class="input-medium"/>
			</li>
			
			
			<!--  
			<li><label>inoutdate：</label>
				<input name="inoutdate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${materialReport.inoutdate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</li>
			-->
			
			
			
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="Search"/></li>
			<li> <input id="btnExport" class="btn btn-primary" type="button" value="Export"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>Material</th>
				<th>price</th>
				<th>currency</th>
				<th>totalqty</th>
				<th>unit</th>
				<th>amount</th>
				<th>standard</th>
				<th>standardunit</th>
				<th>in_out</th>
				<th>office</th>
				<shiro:hasPermission name="warehouse:materialReport:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="materialReport">
			<tr>
				<td><a href="${ctx}/warehouse/materialReport/form?id=${materialReport.id}">
					${materialReport.materialname}
				</a></td>
				<td>
					${materialReport.price}
				</td>
				<td>
					${fns:getDictLabel(materialReport.currency, 'currency', '')}
				</td>
				<td>
					${materialReport.totalqty}
				</td>
				<td>
					${fns:getDictLabel(materialReport.unit, 'unit', '')}
				</td>
				<td>
					${materialReport.amount}
				</td>
				<td>
					${materialReport.standard}
				</td>
				<td>
					${fns:getDictLabel(materialReport.standardunit, 'unit', '')}
				</td>
				<td>
					${fns:getDictLabel(materialReport.inOut, 'inout', '')}
				</td>
				<td>
					${materialReport.office.name}
				</td>
				<shiro:hasPermission name="warehouse:materialReport:edit"><td>
    				<a href="${ctx}/warehouse/materialReport/form?id=${materialReport.id}">修改</a>
					<a href="${ctx}/warehouse/materialReport/delete?id=${materialReport.id}" onclick="return confirmx('确认要删除该MaterialReport吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>